package cn.jiyun.controller;

import cn.jiyun.pojo.DriverChargingItems;
import cn.jiyun.service.DriverChargingItemsService;
import cn.jiyun.vo.ResultCommon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/dri")
@CrossOrigin
public class DriverChargingItemsController {
    @Autowired
    private DriverChargingItemsService driverChargingItemsService;
    @RequestMapping("/findAll")
    public ResultCommon findAll(){
        List<DriverChargingItems> driverChargingItems = driverChargingItemsService.findAll();
        return ResultCommon.suceessData(driverChargingItems);
    }
    @PostMapping("/updatebyid")
    public ResultCommon updatebyid(@RequestBody DriverChargingItems driverChargingItems){
        driverChargingItemsService.updateById(driverChargingItems);
        return ResultCommon.suceess();
    }
}
